<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <title>Logistics个人中心</title>
    <!-- Bootstrap core CSS -->
    <link href="../bootstrap-3.3.7-dist/css/bootstrap.min.css" rel="stylesheet">
    <script src="https://cdn.bootcss.com/html5shiv/3.7.3/html5shiv.min.js"></script>
    <script src="https://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>

<body>
<nav th:replace="~{front/log/log_topbar::top}"></nav>
<div class="container-fluid">
    <div class="row" style="margin-top: 70px">
        <div class="col-md-2 sidebar" style="background: #f6f6f6; height: 100%">
            <ul class="nav nav-sidebar">
                <li style="font-size: 20px">个人资料</li>
                <li><a th:href="@{'/clientCenter?clientAccount='+${clientInfo.clientAccount}}" style="background-color: #428bca; color: #ffffff">个人信息</a></li>
            </ul>
            <ul class="nav nav-sidebar">
                <li style="font-size: 20px">我的订单</li>
                <li><a th:href="@{'/clientCenterOrderAll?clientAccount='+${clientInfo.clientAccount}}">全部订单</a></li>
                <li><a th:href="@{'/clientCenterOrderFinished?clientAccount='+${clientInfo.clientAccount}}">已完成</a></li>
                <li><a th:href="@{'/clientCenterOrderUnfinished?clientAccount='+${clientInfo.clientAccount}}">未接单</a></li>
                <li><a th:href="@{'/clientCenterOrderReceived?clientAccount='+${clientInfo.clientAccount}}">已接单</a></li>
                <li><a th:href="@{'/clientCenterOrderRefused?clientAccount='+${clientInfo.clientAccount}}">问题订单</a></li>
            </ul>
        </div>
        <div class="col-md-10 main">
            <form method="post" action="/client_xiugai" autocomplete="off" onkeydown="if(event.keyCode===13) return false;">
                <input hidden name="clientPassword" th:value="${clientInfo.clientPassword}">
                <input hidden name="clientId" th:value="${clientInfo.clientId}">
                <input hidden name="clientAccount" th:value="${clientInfo.clientAccount}">
                <h2 class="sub-header">个人信息</h2>
                <hr>
                <p style="margin-bottom: 30px; margin-left: 12px">
                    <span style="color: #666666">账号:</span>
                    <span style="font-weight: bold" th:text="${clientInfo.clientAccount}"></span>
                </p>
                <p style="margin-bottom: 30px; margin-left: 12px">
                    <span style="color: #666666">姓名:</span>
                    <input name="clientName" th:value="${clientInfo.clientName}">
                    <!--<span style="font-weight: bold" th:text="${clientInfo.clientName}"></span>-->
                </p>
                <p style="margin-bottom: 30px; margin-left: 12px">
                    <span style="color: #666666">手机:</span>
                    <input name="clientPhone" th:value="${clientInfo.clientPhone}">
                    <!--<span style="font-weight: bold" th:text="${clientInfo.clientPhone}"></span>-->
                </p>
                <p style="margin-bottom: 30px; margin-left: 12px">
                    <span style="color: #666666">邮箱:</span>
                    <input name="clientEmail" th:value="${clientInfo.clientEmail}">
                    <!--<span style="font-weight: bold" th:text="${clientInfo.clientEmail}"></span>-->
                </p>
                <p style="margin-bottom: 30px; margin-left: 19px">
                    <span style="color: #666666">QQ:</span>
                    <input name="clientQq" th:value="${clientInfo.clientQq}">
                    <!--<span style="font-weight: bold" th:text="${clientInfo.clientQq}"></span>-->
                </p>
                <p style="margin-bottom: 30px">
                    <span style="color: #666666">所在地:</span>
                    <select style="width: 150px; height: 26px; border: 1px solid #b6bec5" name="clientProvince" id="province1">
                        <option th:text="${clientInfo.clientProvince}">请选择</option>
                    </select>
                    <select style="width: 150px; height: 26px; border: 1px solid #b6bec5" name="clientCity" id="city1">
                        <option th:text="${clientInfo.clientCity}">请选择</option>
                    </select>
                    <select style="width: 150px; height: 26px; border: 1px solid #b6bec5" name="clientCountry" id="country1">
                        <option th:text="${clientInfo.clientCountry}">请选择</option>
                    </select>
                    <!--<span style="font-weight: bold" th:text="${clientInfo.clientProvince}+'-'+${clientInfo.clientCity}+'-'+${clientInfo.clientCountry}"></span>-->
                </p>
                <p>
                    <span>详细街道/门牌号:</span>
                    <input style="width: 400px" name="clientAddress" th:value="${clientInfo.clientAddress}">
                    <!--<span style="font-weight: bold" th:text="${clientInfo.clientAddress}"></span>-->
                </p>
                <p>
                    <button type="submit" class="btn btn-info">保存</button>
                </p>
            </form>
        </div>
    </div>
</div>

<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="../jquery-3.3.1.js"></script>
<script src="../bootstrap-3.3.7-dist/js/bootstrap.min.js"></script>
<script>
    //出发地
    $(function () {
        ProvinceBind1();

        $("#province1").change(function () {
            CityBind1();
        })

        $("#city1").change(function () {
            CountryBind1();
        })
    });
    function ProvinceBind1() {
        // $("#province1").html("");
        var str = "<option> 请选择省 </option>";
        $.ajax({
            url: "/getProvince",
            success: function (data) {
                $.each(data.data, function (i,item) {
                    str += "<option value=" + item.cityName + ">" + item.cityName + "</option>";
                })
                $("#province1").append(str);
            },
            error: function () {
                alert("Error省");
            }
        })
    }

    function CityBind1() {
        $("#city1").html("");
        var options = $("#province1 option:selected");
        var province = options.val();//province为选中省份的cityName
        // alert(province);
        if (province == "")
            return ;
        $("#city1").html("");
        var str="<option> 请选择市 </option>";

        $.ajax({
            url: "/getCities",
            data: {"parentCity": province},
            success: function (data) {
                $.each(data.data, function (i, item) {
                    str += "<option value=" + item.cityName + ">" + item.cityName + "</option>";
                });
                $("#city1").append(str);
            },
            error: function () {
                alert("Error市");
            }
        });
    }

    function CountryBind1() {
        $("#country1").html("");
        var options = $("#city1 option:selected");
        var city = options.val();
        if (city == "")
            return;
        $("#country1").html();
        var str="<option> 请选择县 </option>";

        $.ajax({
            url: "/getCountries",
            data: {"parentCity": city},
            success: function (data) {
                $.each(data.data, function (i, item) {
                    str += "<option value=" + item.cityName + ">" + item.cityName + "</option>";
                });
                $("#country1").append(str);
            }
        });
    }
</script>
</body>
</html>
